﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace Utilities
{
    public class FileUtils
    {
        /****************************************************************
         * 
         * 只砍掉該目錄下的檔案
         * 不會把目錄也砍了
         * 
         * ***************************************************************/
        public static  void DeleteSubFilesOnly(String path)
        {
            if (Directory.Exists(path) == false)
                return;
            string[] dirs = Directory.GetDirectories(path);
            foreach (String dir in dirs)
            {
                Directory.Delete(dir);
            }
            string[] subFiles = Directory.GetFiles(path);
            foreach (String file in subFiles)
            {
                File.Delete(file);
            }
        }

    }
}
